#include <stdio.h>
#include <ctype.h>

int main() {
	char a[1000];
	gets(a);
	int len = 0;
	for (len = 0; a[len] != '\0'; len++);
	a[len] = ' ';
	int len1 = 0;
	int end;
	for (int i = 0; a[i] != '\0'; i++) {
		if (isalpha(a[i])) {
			len1++;
		} else {
			if (isalpha(a[i - 1])) {
				end = i;
				putchar('[');
				for (int j = end - len1; j < end; j++) {
					putchar(a[j]);
				}
				putchar(']');
			}
			len1 = 0;
		}
	}
	return 0;
}